/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.servinf.ani.sincronizador.entities;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author mortiz
 */
@Entity
@Table(name = "modo_transporte", catalog = "ani_admin", schema = "public")
@NamedQueries({
    @NamedQuery(name = "ModoTransporte.findAll", query = "SELECT m FROM ModoTransporte m")})
public class ModoTransporte implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "modo_transporte_id")
    private Integer modoTransporteId;
    @Basic(optional = false)
    private String nombre;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "modoTransporte")
    private List<Proyecto> proyectoList;

    public ModoTransporte() {
    }

    public ModoTransporte(Integer modoTransporteId) {
        this.modoTransporteId = modoTransporteId;
    }

    public ModoTransporte(Integer modoTransporteId, String nombre) {
        this.modoTransporteId = modoTransporteId;
        this.nombre = nombre;
    }

    public Integer getModoTransporteId() {
        return modoTransporteId;
    }

    public void setModoTransporteId(Integer modoTransporteId) {
        this.modoTransporteId = modoTransporteId;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public List<Proyecto> getProyectoList() {
        return proyectoList;
    }

    public void setProyectoList(List<Proyecto> proyectoList) {
        this.proyectoList = proyectoList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (modoTransporteId != null ? modoTransporteId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ModoTransporte)) {
            return false;
        }
        ModoTransporte other = (ModoTransporte) object;
        if ((this.modoTransporteId == null && other.modoTransporteId != null) || (this.modoTransporteId != null && !this.modoTransporteId.equals(other.modoTransporteId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.servinf.ani.sincronizador.entities.ModoTransporte[ modoTransporteId=" + modoTransporteId + " ]";
    }
    
}
